﻿/********
* 
* 
*  Description:
*  Create By Kain at 4/2/2011 2:39:47 PM
*  
*
*  Revision History:
*  Date                  Who                 What
*  
* 
*/

#region

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

#endregion

namespace Cherry.Agile.ServiceModel.Runtime
{
    public class DomainAgent : MarshalByRefObject, IDisposable
    {
        public IServiceRunner CreateRunner( )
        {
            return new RemoteServiceRunner();
        }

        public static DomainAgent CreateInstance(AppDomain targetDomain)
        {
            System.Runtime.Remoting.ObjectHandle oh = targetDomain.CreateInstance(Assembly.GetExecutingAssembly().FullName, typeof(DomainAgent).FullName);
            object obj = oh.Unwrap();
            return (DomainAgent)obj;
        }
        

        public void Dispose()
        {
             
        }
    }
}
